#include "mainwindow.h"
#include <QApplication>
//#include <QLabel>
//#include <QPushButton>
#include<QHBoxLayout>
#include<QSlider>
#include<QSpinBox>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
   // QLabel *label=new QLabel("<h1><i>hello</i>"
                            // "<font color=red>QT!</font></h1>");
    //label->show();
    //QPushButton *button=new QPushButton("Quit");
    //QObject::connect(button,SIGNAL(clicked()),&a,SLOT(quit()));
    //button->show();
    QWidget *window=new QWidget;
    window->setWindowTitle("enter your age");

    QSpinBox *spinbox=new QSpinBox;
    QSlider *slider=new QSlider;
    spinbox->setRange(0,130);
    slider->setRange(0,130);

    QObject::connect(spinbox,SIGNAL(valueChanged(int)),
                     slider,SLOT(setValue(int)));
    QObject::connect(slider,SIGNAL(valueChanged(int)),
                     spinbox,SLOT(setValue(int)));
    spinbox->setValue(35);

    QHBoxLayout *layout=new QHBoxLayout;
    layout->addWidget(spinbox);
    layout->addWidget(slider);
    window->setLayout(layout);

    window->show();

    return a.exec();
}
